import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import First from '@/components/First'
import Two from '@/components/Two'
import Mintui from '@/components/MintUI/Index'
import myIndex from '@/pages/Index'
import myBlog from '@/pages/Blog'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/first',
      name: 'First',
      component: First
    },
    {
      path: '/two',
      name: 'Two',
      component: Two
    },
    {
      path: '/mintui',
      name: 'Mintui',
      component: Mintui
    },
    {
      path: '/myapp',
      name: 'myIndex',
      component: myIndex
    },
    {
      path: '/blogs',
      name: 'blogs',
      component: myBlog
    },
    {
      path: '/blogs_detail',
      name: 'blogs_detail',
      component(resolve) {
        require(['@/pages/BlogDetail'], resolve); // 和上面的compoent参数指定组件一样的效果
      }
    },
    {
      path: '/images',
      name: 'images',
      component(resolve) {
        require(['@/pages/Images'], resolve); // 和上面的compoent参数指定组件一样的效果
      }
    },
    {
      path: '/img_detail',
      name: 'img_detail',
      component(resolve) {
        require(['@/pages/ImgDetail'], resolve); // 和上面的compoent参数指定组件一样的效果
      }
    },
    {
      path: '/user',
      name: 'user',
      component(resolve) {
        require(['@/pages/user'], resolve);
      }
    },
    {
      path: '/game',
      name: 'game',
      component(resolve) {
        require(['@/pages/game'], resolve);
      }
    }
  ]
})
